package com.northpool.operator.pub.service;

import com.northpool.operator.annotation.InputParam;
import com.northpool.operator.annotation.InputParams;
import com.northpool.operator.annotation.OperatorInfo;
import com.northpool.operator.annotation.OutputParam;
import com.northpool.operator.annotation.OutputParams;
import com.northpool.operator.type.TypeEnum;

@OperatorInfo(
        ref = "PubWMSServer",
        name = "发布WMS服务"
)
@OutputParams({
        @OutputParam(ref = "layer_url", name = "底图服务地址", type = TypeEnum.STRING),
        @OutputParam(ref = "label_url", name = "注记服务地址", type = TypeEnum.STRING)
})
public class PubWMSServer extends PubVecServer {

    @InputParams({
            @InputParam(ref = "serviceUrl", name = "空服URL地址", desc = "空服服务根路径，如: http://192.168.164.45:8021", type = TypeEnum.STRING, required = true),
            @InputParam(ref = "dataSourceId", name = "数据源ID", desc = "数据源ID", type = TypeEnum.DATASOURCE, required = true),
            @InputParam(ref = "tableName", name = "数据表名称", desc = "数据表名称，如: public.table", type = TypeEnum.STRING, required = true),
            @InputParam(ref = "serviceId", name = "服务ID", desc = "矢量瓦片服务名称", type = TypeEnum.STRING, required = true),
            @InputParam(ref = "styleId", name = "样式ID", desc = "矢量瓦片样式名称", type = TypeEnum.STRING, required = true),
            @InputParam(ref = "fields", name = "字段列表", desc = "数据字段列表，多个逗号隔开，如: f_id,dlmc,dlbm", type = TypeEnum.STRING, required = true),
            @InputParam(ref = "styleJson", name = "样式JSON", desc = "样式JSON", type = TypeEnum.STRING, required = false, value = "{\"strokeWidth\":\"1\",\"strokeColor\":\"#da0012\",\"fillOpacity\":\"1\",\"fillColor\":\"#da0012\",\"strokeOpacity\":\"1\"}"),
            @InputParam(ref = "token", name = "用户TOKEN", desc = "平台用户TOKEN", type = TypeEnum.STRING, required = false)
    })
    public PubWMSServer() {
        LAYER_TEMPLATE_URL = "%s/mapserver/layer/WMS/1.3.0/%s/%s/getMap";
    }
}
